//
//  KTElementTableCell.m
//  BoWuGuan
//
//  Created by 梁尚嘉 on 2016/11/3.
//  Copyright © 2016年 KT. All rights reserved.
//

#import "KTElementTableCell.h"
@interface KTElementTableCell()
@property (nonatomic, strong, readwrite) UILabel *elementLabel;
@end

@implementation KTElementTableCell

- (void)configure
{
    [super configure];
    self.clipsToBounds = YES;
    self.backgroundColor = SM_whiteColor;
    self.contentView.backgroundColor = [UIColor clearColor];
    [self.contentView addSubview:self.elementLabel];
    [self.elementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(SM_SIZE(30)));
        make.top.bottom.equalTo(@0);
        make.right.equalTo(@(SM_SIZE(-30)));
    }];

}

#pragma mark - Getters
- (UILabel *)elementLabel
{
    if (!_elementLabel) {
        _elementLabel = [UILabel new];
        _elementLabel.font = kElementTableCellFont;
        _elementLabel.textColor = SM_darkGrayColor;

    }
    return _elementLabel;
}

+ (CGFloat)cellHeight
{
    return SM_SIZE(100);
}

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
    [super setHighlighted:highlighted animated:animated];
    if (self.canHighLight) {
        self.backgroundColor = highlighted ? HEXCOLOR(@"F6F6F6") : SM_whiteColor;
    }
}

@end
